package cn.tedu;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class Demo07 {
    public static void main(String[] args) {
        try (Connection conn = DBUtils.getConn();) {

            Statement s = conn.createStatement();
            ResultSet rl = s.executeQuery("select * from hero; ");
            while(rl.next()){
                int id = rl.getInt(1);
                String name = rl.getString(2);
                double money = rl.getDouble(3);
                System.out.println(id+"\t"+name+"\t"+money);
            }

        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }
    }
}
